#ifndef __DEBUG_H__
#define __DEBUG_H__



#define ASSERT(condition)\
    do{\
        if(!(condition)){\
            dmsg((char*)(__FUNCTION__), __LINE__);\
            return;\
        }\
    }while(0);


#define ASSERT_RET(condition, ret)\
    do{\
        if(!(condition)){\
            dmsg((char*)(__FUNCTION__), __LINE__);\
            return ret;\
        }\
    }while(0);


#define ASSERT_FUNC(condition, do_ext)\
    do{\
        if(!(condition)){\
            do_ext;\
            dmsg((char*)(__FUNCTION__), __LINE__);\
            return;\
        }\
    }while(0);



#define ASSERT_RET_FUNC(condition, ret, do_ext)\
    do{\
        if(!(condition)){\
            do_ext;\
            dmsg((char*)(__FUNCTION__), __LINE__);\
            return (ret);\
        }\
    }while(0);



void dmsg(char *func, int line);



#endif

